Fix SWTBot test: Use ceiling directory
[egit.git] / org.eclipse.egit.doc / userguide / EGit User Guide.html
blobd29449c9013d47d81709aec5b293e028a7adae16
1 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>EGit User Guide</title>
6 <link type="text/css" rel="stylesheet" href="book.css" />
7 </head>
8 <body>
9 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
10 <tr>
11 <th style="width: 100%" align="center" colspan="3">EGit User Guide</th>
12 </tr>
13 <tr>
14 <td style="width: 20%" align="left" />
15 <td style="width: 60%" align="center" />
16 <td style="width: 20%" align="right">
17 <a href="Creating-a-new-empty-Git-Repository.html" title="Creating a new empty Git Repository">
18 <img alt="Next" border="0" src="images/next.gif" />
19 </a>
20 </td>
21 </tr>
22 <tr>
23 <td style="width: 20%" align="left" valign="top" />
24 <td style="width: 60%" align="center" />
25 <td style="width: 20%" align="right" valign="top">Creating a new empty Git Repository</td>
26 </tr>
27 </table>
28 <hr />
29 <h1 id="Getting_Started.2FAdding_a_project_to_version_control">Getting Started/Adding a project to version control</h1>
30 <p>Create a new Java project "HelloWorld"</p>
31 <p>
32 <img border="0" src="images/01-CreateNewJavaProject.png" />
33 </p>
34 <p>Select "File" -> "Team" -> "Share Project"</p>
35 <p>
36 <img border="0" src="images/02-TeamShareProject.png" />
37 </p>
38 <p>Select repository type "Git" and click "Next"</p>
39 <p>
40 <img border="0" src="images/03-SelectRepositoryTypeGit.png" />
41 </p>
42 <p>To configure the Git repository select the new Eclipse project HelloWorld</p>
43 <p>
44 <img border="0" src="images/04-SelectProjectToConfigureGitRepository.png" />
45 </p>
46 <p>Click "Create" to initialize a new Git repository for the HelloWorld project. If your project already resides in the working tree of an exisiting GIT repository the repository is chosen automatically.</p>
47 <p>
48 <img border="0" src="images/05-CreateNewGitRepository.png" />
49 </p>
50 <p>Click "Finish" to close the wizard.</p>
51 <p>The decorator text "
52 <a href="master">master</a>" behind the project shows that this project is tracked in a repository on the master branch
53 and the question mark decorators show that the ".classpath" and ".project" files are not yet under version control
54 </p>
55 <p>
56 <img border="0" src="images/06-NewGitRepository.png" />
57 </p>
58 <p>Select "Team" -> "Add to version control" on the project node</p>
59 <p>
60 <img border="0" src="images/07-AddToVersionControl.png" />
61 </p>
62 <p>The plus decorators show that now the ".classpath" and ".project" files are added to version control</p>
63 <p>Create a file .gitignore in the project folder with the following content:</p>
64 <p>bin</p>
65 <p>This excludes the bin folder from GIT's list of untracked files. Add .gitignore to version control.</p>
66 <p>
67 <img border="0" src="images/08-AddedToVersionControl.png" />
68 </p>
69 <p>The file under ".settings" is not added to version control since it is by default on the list of ignored resources which can be changed in "Preferences" -> "Team" -> "Ignored Resources"</p>
70 <p>
71 <img border="0" src="images/09-IgnoredResources.png" />
72 </p>
73 <p>Select "Team" -> "Commit" from the context menu on the project</p>
74 <p>
75 <img border="0" src="images/10-ClickCommit.png" />
76 </p>
77 <p>Enter a commit message explaining your change, the first line (separated by an empty line) will become the short log for this commit. By default the author and committer are taken from the .gitconfig file in your home directory. You may check the checkbox "Add Signed-of-by" to add a Signed-off-by tag. If you are committing the change of another author you may alter the author field to give the name and email address of the author. Click "Commit" to commit your first change.</p>
78 <p>
79 <img border="0" src="images/11-CommitDialog.png" />
80 </p>
81 <p>Note that the decorators of the committed files changed.</p>
82 <p>
83 <img border="0" src="images/12-CommittedFiles.png" />
84 </p>
85 <p>Select "Team" -> "Show in Resource History" from the context menu to inspect the history of a resource</p>
86 <p>
87 <img border="0" src="images/13-SelectResourceHistory.png" />
88 </p>
89 <p>
90 <img border="0" src="images/14-ResourceHistory.png" />
91 </p>
92 <p>Create a new Java class HelloWorld and implement it, then add it to version control and commit your change.
93 Improve your implementation and commit the improved class, the resource history should now show 2 commits for this class.</p>
94 <p>
95 <img border="0" src="images/15-FirstImplementation.png" />
96 </p>
97 <p>Double click "src/HelloWorld.java" in the Resource History View to open your last committed change in the Eclipse compare view</p>
98 <p>
99 <img border="0" src="images/16-ShowChange.png" />
100 </p>
101 <hr />
102 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
103 <tr>
104 <td style="width: 20%" align="left" />
105 <td style="width: 60%" align="center" />
106 <td style="width: 20%" align="right">
107 <a href="Creating-a-new-empty-Git-Repository.html" title="Creating a new empty Git Repository">
108 <img alt="Next" border="0" src="images/next.gif" />
109 </a>
110 </td>
111 </tr>
112 <tr>
113 <td style="width: 20%" align="left" valign="top" />
114 <td style="width: 60%" align="center" />
115 <td style="width: 20%" align="right" valign="top">Creating a new empty Git Repository</td>
116 </tr>
117 </table>
118 </body>
119 </html>